package com.ghck.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ghck.server.dao.provider.TestAnswerItemProvider;
import com.ghck.server.model.TestAnswerItem;
import com.ghck.server.model.query.TestAnswerItemQuery;
 public interface TestAnswerItemMapper {
 	
 	/**
 	*根据id删除 答案选项
 	*/
 	@Delete("delete from t_test_answer_item where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	/**
 	* 批量新增 答案选项
 	*/
 	@InsertProvider(method="batchInsert",type=TestAnswerItemProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends TestAnswerItem> testAnswerItems);
 	
 	/**
 	* 新增 答案选项
 	*/
 	@InsertProvider(method="insert",type=TestAnswerItemProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(TestAnswerItem domain);
 
 	
 	/**
 	*更新 答案选项
 	*/
 	@UpdateProvider(method="update",type=TestAnswerItemProvider.class)
 	public Integer update(TestAnswerItem domain);
 	
 	/**
 	*根据ID查询 答案选项
 	*/
	@Select("select * from t_test_answer_item where id=#{id}")
	public TestAnswerItem findById(Integer id);
	
	/**
 	*通过query 查询 答案选项
 	*/
 	@SelectProvider(method="findByQuery",type=TestAnswerItemProvider.class)
 	public List<TestAnswerItem> findByQuery(TestAnswerItemQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=TestAnswerItemProvider.class)
 	public Integer countByQuery(TestAnswerItemQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=TestAnswerItemProvider.class)
 	public List<TestAnswerItem> findByIds(List<Integer> ids);
 	

}	